/* response消息模板 */
const responseMsg = (data, status) => {
  let modal = {
    code: 0,
    data,
  };
  if (status === "success") {
    return modal;
  }
  if (status === "error") {
    console.warn("error:", data);
    return { ...modal, error: "sth error", code: 500, data: null };
  }
};

module.exports = {
  responseMsg,
};
